package com.lecture.java8.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author luyn
 * @version 1.0
 * @description
 * @date 2021/9/29 16:18
 */
public class ExecutorDemo {
    private static ExecutorService executorService = Executors.newCachedThreadPool();

    public static void main(String[] args) {
        try {
            System.out.println("开始运行。");
            executorDemo();
            Thread.sleep(8000);
            System.out.println("运行结束。");
        } catch (Exception e) {

        }
    }

    public static void executorDemo() {
        executorService.submit(() -> {
            System.out.println("开启了一个线程。。。。");
        });
    }
}
